﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DelegateLearn
{
 
    

    
    class Test
    {
      
        static void Main()
        {
            //定义一个委托数组
            Action[] actions = new Action[3];

            for (int i = 0; i < 3; i++)
            {
                actions[i] = () => Console.WriteLine(i);
            }

            foreach (Action a in actions) a();
            Console.ReadLine();

           
        }

      
    }
}
